package com.weixin.controller;

import com.weixin.bean.Student;
import com.weixin.mapper.StudentMapper;
import com.weixin.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Controller
public class RenderController {

    @Autowired
    private StudentService studentService;


    @GetMapping("/student")
    public String students(){
        return "student/index";
    }

    @GetMapping("student/preadd/{id}")
    public String student(@PathVariable("id")int id){
        Student student = studentService.selectByPrimaryKey(id);
        return "student/add";
    }

}
